//
//  RootViewController.m
//  UI4_Delegate课后作业轻拍返回键盘
//
//  Created by dllo on 15/11/11.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RootViewController.h"
#import "RootView.h"

@interface RootViewController ()/* <UITextFieldDelegate> */

//@property (nonatomic, retain) RootView *rootV;

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:self.view.frame];
    imageV.image = [UIImage imageNamed:@"bg@2x.png"];
    [self.view addSubview:imageV];
    [imageV release];
    
//    self.rootV = [[RootView alloc] initWithFrame:CGRectMake(60, 150, [UIScreen mainScreen].bounds.size.width - 60 * 2, 40)];
//    self.rootV.label.text = @"用户名";
//    self.rootV.textF.placeholder = @"请输入用户名";
//    self.rootV.textF.delegate = self;
//    [self.view addSubview:self.rootV];
//    [_rootV release];
    
        RootView *rootV = [[RootView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
        rootV.label.text = @"用户名";
        rootV.textF.placeholder = @"请输入用户名";
//        rootV.textF.delegate = self;
        [self.view addSubview:rootV];
        [rootV release];
    
    
//    UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
//    [self.view addGestureRecognizer:tapGR];
//    [tapGR release];
    
    
    
}

//- (void)tapAction:(UITapGestureRecognizer *)sender
//{
//    [self.rootV.textF resignFirstResponder];
//}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
